package cn.co.entry;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;

public class CakeDB {
    private static Map<String, Cake> cake = new LinkedHashMap<String, Cake>();
    static {
        cake.put("1", new cn.co.entry.Cake("1", "巧克力蛋糕"));
        cake.put("2", new cn.co.entry.Cake("2", "草莓蛋糕"));
        cake.put("3", new cn.co.entry.Cake("3", "牛奶蛋糕"));
        cake.put("4", new cn.co.entry.Cake("4", "乳酪蛋糕"));


    }
    // 获得所有的蛋糕
    public static Collection<Cake> getAll() {
        return cake.values();
    }
    // 根据指定的id获蛋糕
    public static Cake getCake(String id) {
        return cake.get(id);
    }
}
